#include <iostream>

using namespace std;

class A
{
public:
	//// 我们不实现，编译器也会实现，一般不需要我们自己实现
	//A* operator&()
	//{
	//	cout << "A* operator&()" << endl;

	//	return this;
	//}

	//const A* operator&() const
	//{
	//	cout << "const A* operator&() const" << endl;
	//	return this;
	//}

	//显示给假地址
	//除非不想让别人取到这个类型对象的真实地址

	A* operator&()
	{
		cout << "A* operator&()" << endl;

		return nullptr;
	}

	const A* operator&() const
	{
		cout << "const A* operator&() const" << endl;
		return (const A*)0xffffffff;
	}

private:
	int _a1 = 1;
	int _a2 = 2;
	int _a3 = 3;
};

int main()
{
	A aa1;
	const A aa2;

	cout << &aa1 << endl;
	cout << &aa2 << endl;

	return 0;
}
